import React from 'react'
import { Form, Button, Select } from 'antd'
function CityForm(props) {
  const [form] = Form.useForm()
  const onFinish = (values) => {
    console.log('Finish:', values)
    props.chooseCity(values)
  }
  const onReset = () => {
    form.resetFields()
  }
  const { Option } = Select
  return (
    <Form form={form} name="city_form" layout="inline" onFinish={onFinish}>
      {/* 城市  */}
      <Form.Item name="select_city" label="城市" className="cityControl">
        <Select placeholder="请选择城市">
          <Option value="全部">全部</Option>
          <Option value="北京市">北京市</Option>
          <Option value="天津市">天津市</Option>
          <Option value="深圳市">深圳市</Option>
        </Select>
      </Form.Item>
      {/* 用车模式 */}
      <Form.Item name="select_mode" label="用车模式" className="cityControl">
        <Select placeholder="请选择用车模式">
          <Option value="全部">全部</Option>
          <Option value="指定点停车">指定点停车</Option>
          <Option value="禁停区模式">禁停区模式</Option>
        </Select>
      </Form.Item>
      {/* 营运模式 */}
      <Form.Item name="select_add" label="营运模式" className="cityControl">
        <Select placeholder="请选择加盟模式">
          <Option value="全部">全部</Option>
          <Option value="自营">自营</Option>
          <Option value="加盟">加盟</Option>
        </Select>
      </Form.Item>
      {/* 加盟商授权状态 */}
      <Form.Item
        name="select_state"
        label="加盟商授权状态"
        className="cityControl"
      >
        <Select placeholder="请选择加盟模式">
          <Option value="全部">全部</Option>
          <Option value="已授权">已授权</Option>
          <Option value="未授权">未授权</Option>
        </Select>
      </Form.Item>
      {/* 重置 */}
      <Form.Item>
        <Button
          type="primary"
          onClick={onReset}
          style={{ height: '32px', width: '120px' }}
        >
          重置
        </Button>
      </Form.Item>
      {/* 查询 */}
      <Form.Item>
        <Button type="primary" htmlType="submit" className="submitbutton">
          查询
        </Button>
      </Form.Item>
    </Form>
  )
}

export default CityForm
